package com.xyht.sca_s.student_manage_system.modules.schoolEditor.controller;


import com.xyht.sca_s.student_manage_system.common.commonReturn.ResponseResult;
import com.xyht.sca_s.student_manage_system.common.desEncodeAndDecode.annotation.SecretBody;
import com.xyht.sca_s.student_manage_system.modules.schoolEditor.entity.dto.SmsSchoolEditorAddDto;
import com.xyht.sca_s.student_manage_system.modules.schoolEditor.entity.dto.SmsSchoolEditorUpdateDto;
import com.xyht.sca_s.student_manage_system.modules.schoolEditor.service.SmsSchoolEditorService;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author XYHT
 * @since 2022-12-25
 */
@RestController
@RequestMapping("/schoolEditor")
@SecretBody
public class SmsSchoolEditorController {

    @Resource
    private SmsSchoolEditorService smsSchoolEditorService;

    @ApiModelProperty(value = "校园编辑")
    @PostMapping("/add")
    public ResponseResult addSchoolEditor(@RequestBody SmsSchoolEditorAddDto smsSchoolEditorAddDto){
        return smsSchoolEditorService.addSchoolEditor(smsSchoolEditorAddDto);
    }

    @ApiModelProperty(value = "校园修改")
    @PostMapping("/update")
    public ResponseResult updateSchoolEditor(@RequestBody SmsSchoolEditorUpdateDto smsSchoolEditorUpdateDto){
        return smsSchoolEditorService.updateSchoolEditor(smsSchoolEditorUpdateDto);
    }

    @ApiModelProperty(value = "查看校园编辑")
    @GetMapping("/all")
    public ResponseResult selectSchoolEditorDetail(){
        return smsSchoolEditorService.selectSchoolEditor();
    }
}

